package ads.pin.pinmon.entity;

import java.util.List;

public class Creature extends DrawableGameObject {

	private static final long serialVersionUID = -5948636234414895613L;

	private List<Skill> m_skills;
	private String m_author;
	private String m_kind;
	private int m_health;
	private boolean isAlive;

	public Creature(float x, float y, float width, float height) {
		super(x, y, width, height);

		m_health = 100;
	}

	/**
	 * Ataca uma criatura inimiga, recebendo a criatura a ser atacada e a skill
	 * utilizada no ataque.
	 * 
	 * @param creature
	 *            Criatura atacada.
	 * @param skill
	 *            Skill usada.
	 */
	public void attack(Creature creature, Skill skill) {
		creature.attacked(skill);

	}

	/**
	 * Recebe um ataque de uma criatura, subtraindo a vida atual do dano da
	 * skill.
	 * 
	 * @param skill
	 *            Skill usada no ataque.
	 */
	public void attacked(Skill skill) {
		m_health -= skill.getDamage();

	}

	public List<Skill> getSkills() {
		return m_skills;
	}

	public void setSkills(List<Skill> m_skills) {
		this.m_skills = m_skills;
	}

	public String getAuthor() {
		return m_author;
	}

	public void setAuthor(String author) {
		this.m_author = author;
	}

	public String getKind() {
		return m_kind;
	}

	public void setKind(String kind) {
		this.m_kind = kind;
	}

	public boolean isAlive() {
		return isAlive;
	}

	public void setAlive(boolean isAlive) {
		this.isAlive = isAlive;
	}
}
